feat: add embed on pdfengine - #78
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (3)
📝 WalkthroughWalkthroughThe change adds PDF embedding support. It defines embed metadata, builds multipart embed requests, exposes the embed API route and relation constants, and validates request creation and generated PDF output. ChangesPDF embedding
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant PdfEngineBuilders
participant EmbedRequest
participant PDFEngineAPI
participant PDFOutput
PdfEngineBuilders->>EmbedRequest: create configured embed request
EmbedRequest->>PDFEngineAPI: send JSON metadata and multipart embed content
PDFEngineAPI-->>PDFOutput: return embedded PDF
Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/Gotenberg.Sharp.Api.Client/Domain/Requests/EmbedRequest.cs`:
- Around line 17-23: Update the InvalidOperationException message in
EmbedRequest.Validate to reference the actual EmbedsData property instead of
EmbedsMetadata, preserving the existing validation condition and exception
behavior.
In `@src/Gotenberg.Sharp.Api.Client/Infrastructure/Constants.cs`:
- Around line 276-283: Update the constants in EmbedRelation so Source, Data,
Alternative, Supplement, and Unspecified use Gotenberg’s capitalized
/AFRelationship values instead of lowercase strings.
In `@test/GotenbergSharpClient.Tests/PdfEngineOperationsTests.cs`:
- Around line 231-267: Rename the Emend test to a descriptive <Feature>_Succeeds
name matching the PDF embed operation, such as Embed_Succeeds. In the test
method, dispose the API response using the existing using-var pattern, write it
through a disposed file stream, and remove the result.pdf artifact-writing block
unless it is required for the assertion; assert the disposed result’s length
before disposal.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 8679bc68-5020-4069-a560-ab1ac62bf35e
📒 Files selected for processing (5)
src/Gotenberg.Sharp.Api.Client/Application/Builders/PdfEngineBuilder.cssrc/Gotenberg.Sharp.Api.Client/Domain/Embed/Entry.cssrc/Gotenberg.Sharp.Api.Client/Domain/Requests/EmbedRequest.cssrc/Gotenberg.Sharp.Api.Client/Infrastructure/Constants.cstest/GotenbergSharpClient.Tests/PdfEngineOperationsTests.cs
Hello,
this implements the basic embed endpoint on pdfengine.
https://gotenberg.dev/docs/manipulate-pdfs/attachments
Let me know if there is anything missing or to be changed.
Summary by CodeRabbit
New Features
Tests